const validator = require('../../../helper/validator')
const createValidation = require('../../../helper/createValidation')
const commonValidation = require('../../../constant/commonValidation')

module.exports = {
  find: [
    ...commonValidation.find,
  ],
  create: [
    createValidation('body.type', true, validator.isUtilityTokenType),
    createValidation('body.expired_at', true, validator.isISO8601Date),
    createValidation('body.app', false, validator.isAppType),
    createValidation('body.device', false, validator.isDeviceType),
  ],
  get: [
    createValidation('params.id', true, validator.isUInt),
  ],
  update: [
    createValidation('params.id', true, validator.isUInt),
  ],
  delete: [
    createValidation('params.id', true, validator.isUInt),
  ],
}
